<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
  <title>函数参数默认值</title>
  <link rel="shortcut icon" href="../img/logo.png" type="image/x-icon"/>
  <script src="../js/axios.js"></script>
  <script>
    function fn(a = 0, b, c) {
      let arr = Object.values(arguments)
      for (let i = 0; i < arr.length; i++) {
        console.log(arr[i])
      }
    }
    //遍历参数的个数时，如果有默认值，就return已经遍历的个数
    let len = (function(a,b,c=2){}).length
    console.log(len)
  </script>
</head>
<body>
<div id="app"><!-- todo --></div>
</body>
</html>

